<template>
	<div>
		
		
		<span class='item ' v-for="(item,index) in items"  :class="selected==index?'active':''" @click="selected=index"
		> {{item}}</span>
		

		
	</div>
	
	
	
	
</template>

<script>
	export default{
		name:'Tab',
		data(){
			return{
				selected:0,
				items:['图片','新闻','网页']
			}
		}
	}
</script>

<style scoped>
	.item{
		cursor: pointer;
	}
	.active{
		background-color: black;
		color: white;
	}
	
</style>